<template>
  <div class="dv"><p>{{ msg }}</p></div>
</template>

<script>

export default {
  data(){
    return{
      msg:"Vue.js",
    };
  },
  beforeCreate(){
    console.log("实例创造前："+this.msg);
  },
  created(){
    console.log("实例创造后："+this.msg);
  }

}





// import { onBeforeMount, onMounted } from "vue";

// onBeforeMount(() => {
//   console.log("Dom元素渲染之前", document.querySelector(".dv"));
// });

// onMounted(() => {
//   console.log("Dom元素渲染之后", document.querySelector(".dv"));
// });
</script>

<style>
</style>
